use actix_web::{web, App, HttpServer};
use config::{create_app_web_data, AppWebData};

#[macro_use]
extern crate diesel;

mod aiobs_mock;
mod config;

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    let app_web_data = web::Data::new(create_app_web_data());
    HttpServer::new(move || {
        App::new()
            .app_data(app_web_data.clone())
            .service(crate::aiobs_mock::create_scope())
    })
    .bind(("127.0.0.1", 8085))?
    .run()
    .await
}
